#ifndef DROPWIDGET_H
#define DROPWIDGET_H

#include <QWidget>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QMimeData>
#include <QFileInfo>
#include <QFile>
#include <QFileDialog>
#include <QFileSystemWatcher>
#include <QPainter>
#include <QMessageBox>

namespace Ui {
class DropWidget;
}

class DropWidget : public QWidget
{
    Q_OBJECT

public:
    explicit DropWidget(QWidget *parent = nullptr);
    ~DropWidget();
    QStringList m_licenseFilePathList;
    QStringList m_licenseFileNameList;
    void cleanData();
    QStringList getLicenseFilePathList();
    void deleteFile(QString filename);

protected:
    void dragEnterEvent(QDragEnterEvent *event);
    void dropEvent(QDropEvent *event);
    void paintEvent(QPaintEvent *e);
    void filterLicenseFiles(QFileInfo fileInfo);

private slots:
    void on_pushButton_clicked();

private:
    Ui::DropWidget *ui;
    QString m_repeatFilePath;//记录重复的文件路径
    QList<QUrl> urls;
    QString m_similarFileName;//记录m_licenseFileNameList中存在相似的文件名

signals:
    void addLicenseFile(QStringList licenseFileNameList);

};

#endif // DROPWIDGET_H
